package cn.itcast.demo2;

public class Student {
    //成员变量，全部用private来修饰
    private String name;
    private int age;
    //构造方法，分为无参构造和全参构造
    public Student(){};
    public Student(String name,int age){
        this.name=name;
        this.age=age;
    }
    //公共访问方式：setXXX（），getXXX（）
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
